package com.briup.mt.ai;


import com.baidu.aip.imageclassify.AipImageClassify;

public class AipImageClient {
    //设置APPID/AK/SK
    public static final String APP_ID = "23180614";
    public static final String API_KEY = "fSZjPrpXmZRZQElRZL9yKVCT";
    public static final String SECRET_KEY = "xPGZEIdOVk8q4qrnRCLX3FvEjWtGirFl";

    // 2.本类内部创建对象实例
    private static AipImageClassify instance = null;

    /**
     * 1.构造方法私有化，外部不能new
     */
    private AipImageClient() {}

    // 3.提供一个公有的静态方法，返回实例对象
    public static AipImageClassify getInstance() {
        if (instance == null) {
            instance =  new AipImageClassify(APP_ID, API_KEY, SECRET_KEY);
            instance.setConnectionTimeoutInMillis(2000);
            instance.setSocketTimeoutInMillis(60000);
        }
        return instance;
    }

}